/*
========================================================================
 Name        : WeatherForecastContainer.h
 Author      : Song Yupeng
 Copyright   : Your copyright notice
 Description : 
========================================================================
*/
#ifndef WEATHERFORECASTCONTAINER_H
#define WEATHERFORECASTCONTAINER_H

#include <coecntrl.h>		
#include <aknbutton.h>
#include <stringloader.h>
#include <AknsBasicBackgroundControlContext.h>

class MEikCommandObserver;		
class CEikLabel;
class CAknButton;

/**
 * Container class for WeatherForecastContainer
 * 
 * @class	CWeatherForecastContainer WeatherForecastContainer.h
 */
class CWeatherForecastContainer : public CCoeControl, MCoeControlObserver
	{
public:
	// constructors and destructor
	CWeatherForecastContainer();
	static CWeatherForecastContainer* NewL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	static CWeatherForecastContainer* NewLC( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	void ConstructL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver );
	virtual ~CWeatherForecastContainer();

public:
	// from base class CCoeControl
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl( TInt aIndex ) const;
	TKeyResponse OfferKeyEventL( 
			const TKeyEvent& aKeyEvent, 
			TEventCode aType );
	void HandleResourceChange( TInt aType );
	
protected:
	// from base class CCoeControl
	void SizeChanged();

private:
	// from base class CCoeControl
	void Draw( const TRect& aRect ) const;

private:
	void InitializeControlsL();
	void LayoutControls();
	void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );

	TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
	
private:
	CCoeControl* iFocusControl;
	MEikCommandObserver* iCommandObserver;
	CAknsBasicBackgroundControlContext* iBgContext;
	
private: 
	CEikLabel* iLabel;
	CEikLabel* iLabelWeather;
	CAknButton* iButtonBeijing;
	CAknButton* iButtonShenyang;
	
public: 
	enum TControls
		{
		ELabel1,
		ELabel2,
		EButton1,
		EButton2,
		ELastControl
		};
	};
				
#endif // WEATHERFORECASTCONTAINER_H
